home *** CD-ROM | disk | FTP | other *** search
- ; mstim.a - get system time.
- ; (C) Copyright 1984, 1985 Gregory R. Mansfield - All Rights Reserved.
- ; G. R. Mansfield. 84/07/01.
- ; Ver 1.1-5517.
-
-
- include "include/msdos.ah"
-
- cseg
- public mstim_
-
-
- ; int mstim(tm)
- ; struct tm *tm; /* see <time.h> */
-
- mstim_:
- mov bx,sp ; pointer to structure
- mov di,[bx+2]
- mov ah,FR_GTM ; get time
- int I_FCN
- push dx ; save hundredths
- mov al,dh ; tm_sec - seconds
- cbw
- stosw
- mov al,cl ; tm_min - minutes
- stosw
- mov al,ch ; tm_hour - hours
- stosw
- mov ah,FR_GDT ; get date
- int I_FCN
- cbw ; save weekday
- mov bx,ax
- mov al,dl ; tm_mday - day of month
- stosw
- mov al,dh ; tm_mon - month
- dec ax
- stosw
- mov ax,cx ; tm_year - year
- stosw
- mov [di],bx ; tm_wday - weekday
- pop ax
- cbw
- ret
-